﻿package edu.pku.se.chocolate.UI.View;

import edu.pku.se.chocolate.ChocolateActivity;
import android.app.Activity;
import android.view.View;
/**
 * 所有界面的父类
 * @author 88b
 *
 */
public class ChocolateView {
	protected View self;
	protected static Activity mainActivity;
	public boolean deleteVisible;
	public ChocolateView(View self) {
		this.self = self;
		deleteVisible = false;
	}
	public static void setActivity(Activity mainActivity) {
		ChocolateView.mainActivity = mainActivity;
	}
	public void show() {
		if(ChocolateActivity.view_stack.isEmpty() ||(!(ChocolateActivity.view_stack.peek() == this)))
			ChocolateActivity.view_stack.push(this);
		mainActivity.setContentView(self);
	}
}
